$(document).ready(function(){
	$("#submit").click(function(){
		if($("#teachername").val()!=""&&$("#teacherpassword").val()!=""){
			$.ajax({
				url:"checkInfo",
				data:$("#adminInfo").serialize(),
				type:"POST",
				success:function(data){
					console.log(data);
					if(data.code==100){
						window.location.href="page/index"
					}else{
						reminder("error","登录失败");
						
					}
				}
			});
		}
	});
	//提示信息
	function reminder(Status,msg) {
		swal({
			  title: msg,
			  text: "学生考勤系统",
			  timer: 1500,
			  type:Status,
			  showConfirmButton: false
			});
	}	
});